<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
 Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="Button.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>Button.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		No overview generated for 'Button.js'<BR/><BR/>
	
</p>

<hr>


    <table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
    <td colspan=2><font size="+2">
    
        <b>Class Summary</b>
    
    </font></td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="draw2d/Button.html">draw2d.Button</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    </table>
    <hr/> 


<!-- ========== METHOD SUMMARY =========== -->

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">/* This notice must be untouched at all times.

FreeGroup Draw2D 0.9.26
The latest version is available at
http://www.freegroup.de

Copyright (c) 2006 Andreas Herz. All rights reserved.
Created 5. 11. 2006 by Andreas Herz (Web: http://www.freegroup.de )

LICENSE: LGPL

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (LGPL) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA,
or see http://www.gnu.org/copyleft/lesser.html
*/</span>

<span class="comment">/**
 * 
 * <span class="attrib">@version</span> 0.9.26
 * <span class="attrib">@author</span> Andreas Herz
 * <span class="attrib">@constructor</span>
 */</span>
draw2d.Button=<span class="reserved">function</span>(<span class="comment">/*:draw2d.PaletteWindow*/</span> palette, <span class="comment">/*:int*/</span> width, <span class="comment">/*:int*/</span> height)
{
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.x   = 0;
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.y   = 0;
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.width= 24;
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.height= 24;
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.id  = draw2d.UUID.create();
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.enabled=true;
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.active=false;
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.palette = palette;

  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.html = <span class="reserved">this</span>.createHTMLElement();

  <span class="reserved">if</span>(width!==undefined &amp;&amp; height!==undefined)
    <span class="reserved">this</span>.setDimension(width,height);
  <span class="reserved">else</span>
    <span class="reserved">this</span>.setDimension(24,24);

};

draw2d.Button.<span class="reserved">prototype</span>.type=<span class="literal">"draw2d.Button"</span>;

<span class="comment">/**
 * <span class="attrib">@private</span>
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.dispose=<span class="reserved">function</span>()
{
  <span class="comment">//this.id   = null; don't dispose the id! This is important for deregistration</span>
  <span class="comment">//this.html = null; don't dispose the id! This is important for deregistration</span>
};


draw2d.Button.<span class="reserved">prototype</span>.getImageUrl=<span class="reserved">function</span>()
{
   <span class="reserved">return</span> <span class="reserved">this</span>.type+<span class="literal">".png"</span>;
};


<span class="comment">/**
 * <span class="attrib">@private</span>
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.createHTMLElement=<span class="reserved">function</span>()
{
    var item = document.createElement(<span class="literal">'div'</span>);
    item.id        = <span class="reserved">this</span>.id;
    item.style.position=<span class="literal">"absolute"</span>;
    item.style.left   = <span class="reserved">this</span>.x+<span class="literal">"px"</span>;
    item.style.top    = <span class="reserved">this</span>.y+<span class="literal">"px"</span>;
    item.style.height = <span class="reserved">this</span>.width+<span class="literal">"px"</span>;
    item.style.width  = <span class="reserved">this</span>.height+<span class="literal">"px"</span>;
    item.style.margin = <span class="literal">"0px"</span>;
    item.style.padding= <span class="literal">"0px"</span>;
    item.style.outline= <span class="literal">"none"</span>;

    <span class="reserved">if</span>(<span class="reserved">this</span>.getImageUrl()!==null)
      item.style.backgroundImage=<span class="literal">"url("</span>+<span class="reserved">this</span>.getImageUrl()+<span class="literal">")"</span>;
    <span class="reserved">else</span>
      item.style.backgroundImage=<span class="literal">""</span>;

    var oThis = <span class="reserved">this</span>;
    <span class="reserved">this</span>.omousedown=<span class="reserved">function</span>(event)
    {
       <span class="reserved">if</span>(oThis.enabled)
       {
          oThis.setActive(true);
       }
       event.cancelBubble = true;
       event.returnValue = false;
    }
    <span class="reserved">this</span>.omouseup=<span class="reserved">function</span>(event)
    {
       <span class="reserved">if</span>(oThis.enabled)
       {
          oThis.setActive(false);
          oThis.execute();
          oThis.palette.setActiveTool(null);
       }
       event.cancelBubble = true;
       event.returnValue = false;
    }

    <span class="reserved">if</span> (item.addEventListener) 
    {
      item.addEventListener(<span class="literal">"mousedown"</span>, <span class="reserved">this</span>.omousedown, false);
      item.addEventListener(<span class="literal">"mouseup"</span>, <span class="reserved">this</span>.omouseup, false);
    }
    <span class="reserved">else</span> <span class="reserved">if</span> (item.attachEvent) 
    {
      item.attachEvent(<span class="literal">"onmousedown"</span>, <span class="reserved">this</span>.omousedown);
      item.attachEvent(<span class="literal">"onmouseup"</span>, <span class="reserved">this</span>.omouseup);
    }

    <span class="reserved">return</span> item;
};

<span class="comment">/**
 * <span class="attrib">@private</span>
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.getHTMLElement=<span class="reserved">function</span>()
{
  <span class="reserved">if</span>(<span class="reserved">this</span>.html===null)
    <span class="reserved">this</span>.html = <span class="reserved">this</span>.createHTMLElement();
  <span class="reserved">return</span> <span class="reserved">this</span>.html;
};


<span class="comment">/**
 *
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.execute=<span class="reserved">function</span>()
{
};

draw2d.Button.<span class="reserved">prototype</span>.setTooltip=<span class="reserved">function</span>(<span class="comment">/*:String*/</span> tooltipText)
{
  <span class="reserved">this</span>.tooltip = tooltipText;
  <span class="reserved">if</span>(<span class="reserved">this</span>.tooltip!==null)
     <span class="reserved">this</span>.html.title=<span class="reserved">this</span>.tooltip;
  <span class="reserved">else</span>
     <span class="reserved">this</span>.html.title=<span class="literal">""</span>;

};

<span class="comment">/**
 * Return the associated workflow canvas.
 *
 * <span class="attrib">@since</span> 0.9.19
 * <span class="attrib">@type</span> draw2d.Workflow
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.getWorkflow=<span class="reserved">function</span>()
{
   <span class="reserved">return</span> <span class="reserved">this</span>.getToolPalette().getWorkflow();
}

<span class="comment">/**
 * Return the associated tool palette.
 *
 * <span class="attrib">@since</span> 0.9.19
 * <span class="attrib">@type</span> draw2d.ToolPalette
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.getToolPalette=<span class="reserved">function</span>()
{
   <span class="reserved">return</span> <span class="reserved">this</span>.palette;
}

<span class="comment">/**
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.setActive=<span class="reserved">function</span>(flag <span class="comment">/*:boolean*/</span>)
{
  <span class="reserved">if</span>(!<span class="reserved">this</span>.enabled)
    <span class="reserved">return</span>;
  <span class="reserved">this</span>.active = flag;
  <span class="reserved">if</span>(flag===true)
    <span class="reserved">this</span>.html.style.border=<span class="literal">"1px inset"</span>;
  <span class="reserved">else</span>
    <span class="reserved">this</span>.html.style.border=<span class="literal">"0px"</span>;
};

draw2d.Button.<span class="reserved">prototype</span>.isActive=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> <span class="reserved">this</span>.active;
};

<span class="comment">/**
 * <span class="attrib">@private</span>
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.setEnabled=<span class="reserved">function</span>(flag <span class="comment">/*:boolean*/</span>)
{
  <span class="reserved">this</span>.enabled=flag;
  <span class="reserved">if</span>(flag)
  {
    <span class="reserved">this</span>.html.style.filter=<span class="literal">"alpha(opacity=100)"</span>;
    <span class="reserved">this</span>.html.style.opacity=<span class="literal">"1.0"</span>;
  }
  <span class="reserved">else</span>
  {
    <span class="reserved">this</span>.html.style.filter=<span class="literal">"alpha(opacity=30)"</span>;
    <span class="reserved">this</span>.html.style.opacity=<span class="literal">"0.3"</span>;
  }
};

<span class="comment">/**
 *
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.setDimension=<span class="reserved">function</span>( w <span class="comment">/*:int*/</span>, h <span class="comment">/*:int*/</span>)
{
  <span class="reserved">this</span>.width = w;
  <span class="reserved">this</span>.height= h;

  <span class="comment">// Falls das Element noch nie gezeichnet wurde, dann braucht aus das HTML nicht </span>
  <span class="comment">// aktualisiert werden</span>
  <span class="comment">//</span>
  <span class="reserved">if</span>(<span class="reserved">this</span>.html===null)
    <span class="reserved">return</span>;

  <span class="reserved">this</span>.html.style.width  = <span class="reserved">this</span>.width+<span class="literal">"px"</span>;
  <span class="reserved">this</span>.html.style.height = <span class="reserved">this</span>.height+<span class="literal">"px"</span>;
};

<span class="comment">/**
 *
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.setPosition=<span class="reserved">function</span>(<span class="comment">/*:int*/</span> xPos ,<span class="comment">/*:int*/</span> yPos)
{
  <span class="reserved">this</span>.x = Math.max(0,xPos);
  <span class="reserved">this</span>.y = Math.max(0,yPos);
  <span class="comment">// Falls das Element noch nie gezeichnet wurde, dann braucht aus das HTML nicht </span>
  <span class="comment">// aktualisiert werden</span>
  <span class="comment">//</span>
  <span class="reserved">if</span>(<span class="reserved">this</span>.html===null)
    <span class="reserved">return</span>;

  <span class="reserved">this</span>.html.style.left = <span class="reserved">this</span>.x+<span class="literal">"px"</span>;
  <span class="reserved">this</span>.html.style.top  = <span class="reserved">this</span>.y+<span class="literal">"px"</span>;
};

<span class="comment">/**
 *
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.getWidth=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> <span class="reserved">this</span>.width;
};

<span class="comment">/**
 *
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.getHeight=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> <span class="reserved">this</span>.height;
};

<span class="comment">/**
 *
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.getY=<span class="reserved">function</span>()
{
    <span class="reserved">return</span> <span class="reserved">this</span>.y;
};

<span class="comment">/**
 *
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.getX=<span class="reserved">function</span>()
{
    <span class="reserved">return</span> <span class="reserved">this</span>.x;
};

<span class="comment">/**
 *
 **/</span>
draw2d.Button.<span class="reserved">prototype</span>.getPosition=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> new draw2d.Point(<span class="reserved">this</span>.x, <span class="reserved">this</span>.y);
};

</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Mon Nov 14 13:45:39 2011</div>
</body>
</html>
